package com.xingkeduo.remote.feign;

import com.xingkeduo.dto.AdminDetailDto;
import com.xingkeduo.dto.BaseDTO;
import com.xingkeduo.dto.CraftsmanDTO;
import com.xingkeduo.dto.param.ConsumerPrivateParameterDto;
import com.xingkeduo.dto.wxma.WxMaCodeDTO;
import com.xingkeduo.dto.wxma.WxMaUserInfo;
import com.xingkeduo.util.config.FeignConfig;
import com.xingkeduo.utils.ResponseUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


//用户服务远程调用
@FeignClient(value = "business-user", configuration = FeignConfig.class)
public interface AdminFeignService {

    /**
     * 查询用户信息
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumer/user")
    String user(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 查询用户标签设置
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumer/revise_set")
    String revise_set(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 更改绑定手机号
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumer/ajax_update_mobile")
    String ajax_update_mobile(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "f_code") String f_code, @RequestParam(value = "f_mobile") String f_mobile, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);


    //查询发型师信息
    @RequestMapping("/craftsman/getinfo/{id}")
    ResponseUtils<CraftsmanDTO> getCraftsman(@PathVariable("id") @RequestParam(value = "id") String id);


    /**
     * 获取发型师服务类型
     *
     * @param craftsmanIds
     * @return
     */
    @RequestMapping("/craftsman/service/serviceids")
    ResponseUtils<List<BaseDTO>> serviceids(@RequestBody List<Long> craftsmanIds);


    /**
     * 修改手机号发送验证码
     *
     * @param f_user_id   用户ID
     * @param f_mobile
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumer/ajax_send_sms_vertify_code")
    String ajax_send_sms_vertify_code(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "f_mobile") String f_mobile, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);


    /**
     * 查询work标签
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerPrivate/update_work")
    String update_work(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 修改work标签
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerPrivate/ajax_update_work")
    String ajax_update_work(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "f_professional_attributes") int f_professional_attributes, @RequestParam(value = "mobile_type") String mobile_type);


    /**
     * 查询sex标签
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerPrivate/update_sex")
    String update_sex(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 修改sex标签
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerPrivate/ajax_update_sex")
    String ajax_update_sex(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "f_sex") int f_sex, @RequestParam(value = "mobile_type") String mobile_type);


    /**
     * 查询age标签
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerPrivate/update_age")
    String update_age(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 修改age标签
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerPrivate/ajax_update_age")
    String ajax_update_age(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "selected_tag") int selected_tag, @RequestParam(value = "mobile_type") String mobile_type);


    /**
     * 查询风格定位
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerStyle/update_style")
    String update_style(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 修改风格定位
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumerStyle/ajax_update_style")
    String ajax_update_style(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "choose_style_list_ids") String choose_style_list_ids, @RequestParam(value = "mobile_type") String mobile_type);


    /**
     * 查询到店距离
     *
     * @param f_user_id   用户ID
     * @param time
     * @param token
     * @param mobile_type
     * @return
     */
    @RequestMapping("/consumer/update_care")
    String update_care(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 修改到店距离
     *
     * @param f_user_id:
     * @param time:
     * @param token:
     * @param f_frequency:
     * @param mobile_type:
     * @return : java.lang.String
     * @author : pantong
     */
    @RequestMapping("/consumer/ajax_update_care")
    String ajax_update_care(@RequestParam(value = "f_user_id") long f_user_id, @RequestParam(value = "time") String time, @RequestParam(value = "token") String token, @RequestParam(value = "f_frequency") String f_frequency, @RequestParam(value = "mobile_type") String mobile_type);

    /**
     * 获取发型师信息
     *
     * @param param
     * @return
     */
    @RequestMapping("/craftsman/get/{param}")
    ResponseUtils<AdminDetailDto> craftsman_get(@PathVariable("param") @RequestParam(value = "param") String param);


    /**
     * 小程序拉取code
     *
     * @param js_cod:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/5/8 17:05
     */
    @GetMapping("/consumer/code")
    ResponseUtils<WxMaCodeDTO> code(@RequestParam("js_code") String js_cod, @RequestParam("mobile_type") String mobile_type);

    /**
     * 拉取用户信息
     *
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/5/8 17:15
     */
    @RequestMapping("/consumer/get_user_info")
    ResponseUtils<AdminDetailDto> get_user_info(@RequestBody ConsumerPrivateParameterDto consumerPrivateParameterDto);
//    ResponseUtils<AdminDetailDto> get_user_info(@RequestParam("encryptedData") String encryptedData, @RequestParam("iv") String iv, @RequestParam("sessionKey") String sessionKey, @RequestParam("f_user_id") long f_user_id, @RequestParam("mobile_type") String mobile_type);


    /**
     * 获取用户详情
     *
     * @param id
     * @return
     */
    @GetMapping("/consumer/getinfo/{id}")
    ResponseUtils<WxMaUserInfo> getConsumerInfo(@PathVariable("id") @RequestParam(value = "id") String id);

    /**
     * 支付宝获取code
     *
     * @param code:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/5/22 16:50
     */
    @RequestMapping("/authorization/ali/code")
    ResponseUtils<WxMaUserInfo> aliCode(@RequestParam("code") String code);

    /**
     * 微信获取code
     *
     * @param consumerPrivateParameterDto:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/5/22 16:50
     */
    @RequestMapping("/authorization/save")
    String saveWechatCode(@RequestBody ConsumerPrivateParameterDto consumerPrivateParameterDto);

    /**
     * 验证是否存在该用户id
     *
     * @param f_user_id:
     * @return : com.xingkeduo.utils.ResponseUtils<java.lang.Long>
     * @author : gaozifeng
     * @date : 2019/7/31 19:13
     */
    @RequestMapping("/consumer/checkid/{f_user_id}")
    ResponseUtils<Long> checkUserExist(@PathVariable("f_user_id") Long f_user_id, @RequestParam("mobile_type") String mobile_type);

}
